WebWork 2 : Webwork 2 skinning
This page last changed on Nov 30, 2004 by jcarreira.
Skinning in Webwork 2 can be done more than one way. We will show how to use two skins called "html" and "wml", and we'll be working with the following directory structure: /WEB-INF /web.xml /html /index.jsp /Register.jsp /wml /index.jsp /Register.jsp /index.jsp Classic ApproachIf you want to go the Webwork 1.3 route, simply place all actions in the default namespace so that they are accessible from any URL path. When you create your views, place them in the sub-directory that corresponds with the skin's identifier.Your action configuration would look like this (simplified, without defined interceptors): <package name="default"> <action name="registration" class="x.actionset.Register"> <result name="success" type="dispatcher"> <param name="location">Register.jsp</param> </result> <interceptor-ref name="defaultStack"/> </action> </package> Namespace DefinedIf you require the use of namespaces, you can do the following:Simplified configuration example: <package name="user" extends="default"> <action name="register" class="x.x.actionset.Register"> <result name="success" type="dispatcher"> <param name="location">Register.jsp</param> </result> <interceptor-ref name="defaultStack"/> </action> </package> <package name="user-html" extends="user" namespace="/user/html" /> <package name="user-wml" extends="user" namespace="/user/wml" /> |
Document generated by Confluence on Dec 14, 2004 16:37 |